package org.example.java8.date;

import java.time.LocalDate;
import java.time.temporal.ChronoField;

public class LocalDateTest {
    public static void main(String[] args) {
        //immutable and thread-safe
        LocalDate localDate = LocalDate.of(2020, 07, 16);
        System.out.println(localDate.getYear());
        System.out.println(localDate.getMonth());
        System.out.println(localDate.getMonthValue());
        System.out.println(localDate.getDayOfYear());
        System.out.println(localDate.getDayOfMonth());
        System.out.println(localDate.getDayOfWeek());

        System.out.println(localDate.get(ChronoField.DAY_OF_MONTH));

        System.out.println(LocalDate.now());
    }
}
